package junit;

import domain.Architect;
import domain.Designer;
import domain.Employee;
import org.junit.Test;
import service.NameListService;
import service.TeamException;

/**
 * Classname: NameListServiceTest
 * Package: junit
 * Description:
 * 对NameListService类功能进行测试
 * @Author Alex Liang
 * @Create 2023/12/18 22:45
 * @Version 1.0
 */

public class NameListServiceTest {
    @Test
    public void testGetAllEmployees() {
        NameListService nameListService = new NameListService();
        Employee[] employees = nameListService.getAllEmployees();
        for (int i = 0; i < employees.length; i++) {
            System.out.println(employees[i]);
        }
    }

    @Test
    public void testGetEmployees() {
        try {
            NameListService nameListService = new NameListService();
            int id = 13;
            Employee employee = nameListService.getEmployee(id);
            System.out.println(employee);
        } catch (TeamException e) {
            System.out.println(e.getMessage());
        }

    }

    @Test
    public void test() {
        Architect architect = new Architect();
        Designer designer = new Designer();
        System.out.println(designer instanceof Architect);
        System.out.println(designer instanceof Designer);
    }


}
